package com.zan.springcloud.service;

import com.zan.springcloud.entity.CommonResult;
import com.zan.springcloud.entity.Payment;
import com.zan.springcloud.service.fallback.PaymentFallbackService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @Author Zan
 * @Create 2024/1/6 20:19
 * @Description : 使用 fallback 方式是无法获取异常信息的，如果想要获取异常信息，可以使用 fallbackFactory参数
 */
@FeignClient(value = "nacos-payment-provider", fallback = PaymentFallbackService.class) // 调用中关闭9003服务提供者
public interface PaymentService {
    @GetMapping(value = "/paymentSQL/{id}")
    public CommonResult<Payment> paymentSQL(@PathVariable("id") Long id);
}
